package com.sjr.easy.chat.service.impl;

import com.alibaba.fastjson2.JSON;
import com.sjr.easy.chat.model.InboxMessage;
import com.sjr.easy.chat.service.InboxMessageService;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import com.sjr.easy.chat.repo.InboxMessageRepo;

@Slf4j
@Service
@Transactional
public class InboxMessageServiceImpl implements InboxMessageService {

    @Autowired
    private InboxMessageRepo inboxMessageRepo;

    @Override
    public void addInboxMessage(InboxMessage inboxMessage) {
        log.info("message:{}", JSON.toJSONString(inboxMessage));
        inboxMessageRepo.save(inboxMessage);
    }
}
